package com.zhao.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 用户信息表
 * @TableName consumer_basic_info
 */
@TableName(value ="consumer_basic_info")
@Data
public class ConsumerBasicInfo implements Serializable {
    /**
     * 用户id，加密
     */
    @TableId
    private String consumerId;

    /**
     * 用户昵称
     */
    private String consumerName;

    /**
     * 用户邮箱
     */
    private String consumerEmail;

    /**
     * 邮箱认证状态（0:未认证、1:已认证）
     */
    private Integer consumerEmailState;

    /**
     * 用户号码
     */
    private String consumerPhonum;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 更新人id，可以是用户，也可以是管理员
     */
    private String updateUserId;

    /**
     * 账号状态（0:停用、1:启动），后续可添加其他状态
     */
    private Integer state;

    /**
     * 用户头像信息
     */
    private String consumerImgUrl;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ConsumerBasicInfo other = (ConsumerBasicInfo) that;
        return (this.getConsumerId() == null ? other.getConsumerId() == null : this.getConsumerId().equals(other.getConsumerId()))
            && (this.getConsumerName() == null ? other.getConsumerName() == null : this.getConsumerName().equals(other.getConsumerName()))
            && (this.getConsumerEmail() == null ? other.getConsumerEmail() == null : this.getConsumerEmail().equals(other.getConsumerEmail()))
            && (this.getConsumerEmailState() == null ? other.getConsumerEmailState() == null : this.getConsumerEmailState().equals(other.getConsumerEmailState()))
            && (this.getConsumerPhonum() == null ? other.getConsumerPhonum() == null : this.getConsumerPhonum().equals(other.getConsumerPhonum()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getUpdateUserId() == null ? other.getUpdateUserId() == null : this.getUpdateUserId().equals(other.getUpdateUserId()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getConsumerImgUrl() == null ? other.getConsumerImgUrl() == null : this.getConsumerImgUrl().equals(other.getConsumerImgUrl()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getConsumerId() == null) ? 0 : getConsumerId().hashCode());
        result = prime * result + ((getConsumerName() == null) ? 0 : getConsumerName().hashCode());
        result = prime * result + ((getConsumerEmail() == null) ? 0 : getConsumerEmail().hashCode());
        result = prime * result + ((getConsumerEmailState() == null) ? 0 : getConsumerEmailState().hashCode());
        result = prime * result + ((getConsumerPhonum() == null) ? 0 : getConsumerPhonum().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getUpdateUserId() == null) ? 0 : getUpdateUserId().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getConsumerImgUrl() == null) ? 0 : getConsumerImgUrl().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", consumerId=").append(consumerId);
        sb.append(", consumerName=").append(consumerName);
        sb.append(", consumerEmail=").append(consumerEmail);
        sb.append(", consumerEmailState=").append(consumerEmailState);
        sb.append(", consumerPhonum=").append(consumerPhonum);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", updateUserId=").append(updateUserId);
        sb.append(", state=").append(state);
        sb.append(", consumerImgUrl=").append(consumerImgUrl);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
